<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="/temp/default/js/jquery-3.1.0.min.js"></script>
    <script src="/temp/default/js/flexible.debug.js"></script>
    <script src="/temp/default/js/flexible_css.debug.js"></script>
    <link rel="stylesheet" href="/temp/default/css/order.css">
    <title>昆山朋友圈</title>
</head>
<body>
    <div class="container">
        <header class="title">订单详情</header>
        <div class="cell-box">
            <div class="cell">
                <span class="left">商品名称</span>
                <span class="right">定位红包支付</span>
            </div>
            <div class="line"></div>
            <div class="cell">
                <span class="left">订单编号</span>
                <span class="right">{$orderinfo.ordersn}</span>
            </div>
            <div class="line"></div>
            <div class="cell">
                <span class="left">商检名称</span>
                <span class="right">未来动力科技微广告</span>
            </div>
            <div class="line"></div>
            <div class="cell">
                <span class="left">商品价格</span>
                <span class="right green">￥{$orderinfo.cost}元</span>
            </div>
        </div>
        <div class="cell-box" style="margin-top: 0.4rem">
            <div class="cell">
                <span class="left">还需支付</span>
                <span class="right green">￥{$orderinfo.cost}元</span>
            </div>
        </div>
        <header class="title">选择支付方式</header>
        <div class="cell-box" onclick="callpay()">
            <div class="pay-box">
                <img src="/temp/default/image/weixin.png" alt="" srcset=""/>
                <div class="info">
                    <p class="pay-title">微信支付</p>
                    <p class="pay-desc">微信支付，安全快捷(必须使用微信内置浏览器)</p>
                </div>
            </div>
            <div class="line"></div>
            <!--<div class="pay-box" onclick="apay()">-->
                <!--<img src="./image/apay.png" alt="" srcset=""/>-->
                <!--<div class="info">-->
                    <!--<p class="pay-title">支付宝</p>-->
                    <!--<p class="pay-desc">简单、安全、快速</p>-->
                <!--</div>-->
            <!--</div>-->
        </div>
    </div>
    <script>

        function jsApiCall()
        {
            WeixinJSBridge.invoke(
                    'getBrandWCPayRequest',
                    {$jsApiParameters},
                    function(res){
                        //WeixinJSBridge.log(res.err_msg);
                        if(res.err_msg=='get_brand_wcpay_request:ok'){
                            var ordersn = {$orderinfo.ordersn};
                            var navURL = "http://dingwei.famishare.me/index.php?action=paysuc&ordersn="+ordersn;
                            window.location.href = navURL;
                        }else{
                            alert(res.err_code+'|'+res.err_desc+'|'+res.err_msg);
                        }
                    }
            );
        }

        function callpay()
        {
            if (typeof WeixinJSBridge == "undefined"){
                if( document.addEventListener ){
                    document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
                }else if (document.attachEvent){
                    document.attachEvent('WeixinJSBridgeReady', jsApiCall);
                    document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
                }
            }else{
                jsApiCall();
            }
        }
    </script>
</body>
</html>